<!-- TrainStatisticalAnalysis.html -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
     <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>统计分析</title>
    <link href="../../css/mui.min.css" rel="stylesheet"/>
    		

   	<link rel="stylesheet" type="text/css" href="../../css/base.css">
   	<style type="text/css" media="screen">
   		.base_item_icon{
   			padding: 0;
   			margin-left: 12px;
   			margin-top: 12px;
   		}
   	</style>
   	<!-- <link rel="stylesheet" href="../../css/weui.min.css">
   	<link rel="stylesheet" href="../../css/jquery-weui.min.css"> -->
</head>
<body>
    <div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div> 
	<div class="base_navigation_bar base_style_color base_navigation_item_bar">
		<a class="base_left_item" href="#" onclick="backClick()">
			<img class="base_back_icon" src="../../image/icon_jiantou.png" alt="">
		</a>
		<span >统计分析</span>
		<a class="base_right_item" onclick="onShareClick()">
			<img class="base_item_icon" src="../../image/icon_lan.png" alt="">
		</a>
		<!-- <a class="base_right_item" data-target="#pushshare">
			<img class="base_item_icon" src="../../image/icon_lan.png" alt="">
		</a> -->
	</div>
	
<!-- <div id="pushshare" class='weui-popup-container popup-bottom'>
	    <div class="weui-popup-modal">
		    <div class="toolbar">
		        <div class="toolbar-inner">
		            <a href="javascript:;" class="picker-button close-popup">关闭</a>
		            <h1 class="title">分享</h1>
		        </div>
		    </div>
		    <div class="modal-content">
			    <div class="weui_grids">
			        <a href="javascript:;" class="weui_grid js_grid" data-id="dialog">
			            <div class="weui_grid_icon">
			                <img src="../../image/icon_qq.png" alt="">
			            </div>
			            <p class="weui_grid_label">
			                QQ好友
			            </p>
			        </a>
			    </div>
	        </div>
        </div>
    </div> -->
    <div class="base_content_div">
    	<div class="loadFailure" hidden="hidden" id="noNet">
	        <img src="../../image/icon_img01.png" width="60%">
	        <p class="" >
	            数据加载失败
	        </p>
	        <p>
	            请检查您的网络
	        </p>
	        <button type="button" class="mui-btn mui-btn-outlined" onclick="parpreData()">
	            重新加载
	        </button>
	    </div>
    </div>
  
</body>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/MD5.js"></script>
<script type="text/javascript" src="../../script/requestTool.js"></script>
<!-- <script type="text/javascript" src="../../script/jquery-weui.min.js"></script> -->
<script type="text/javascript">
	var url = '';
	apiready = function(){
		parpreData();
	}
	function parpreData(){
		var connectionType = api.connectionType;
		if (connectionType == 'none') {//断网
			$('#noNet').show();
//			api.toast({
//			    msg: '暂无网络！'
//			});
		}else{
			$('#noNet').hide();
			setupSubframe();
		}
	}
	function setupSubframe(){
		url = urlShare + '&uid=' + $api.getStorage('cfnetppuid') + '&jid=' + $api.getStorage('cfnetppjid');
		var y = $('.base_navigation_bar').height();
		var h = api.winHeight - y;
		api.openFrame({
		    name: 'ShareStatisticalAnalysis',
		    url: url,
		    rect: {
		        x: 0,
		        y: y,
		        w: 'auto',
		        h: h
		    },
		    bounces: false,
		    vScrollBarEnabled: true,
		    hScrollBarEnabled: false
		});
	}
	function backClick(){
		api.closeWin();
	}
	function onShareClick(){
		    var dialogBox = api.require('dialogBox');
		    dialogBox.actionMenu ({
		    tapClose:true,
		    rect:{
		        h: 150
		    },
		    texts:{
		         cancel: '取消'
		    },
		    items:[
		    {
		        text: '微信',
		        icon: 'widget://image/icon_weixin.png'
		    },
		    {
		        text: 'QQ',
		        icon: 'widget://image/icon_qq.png'
		    },
		    {
		        text: '朋友圈',
		        icon: 'widget://image/icon_pengyouquan.png'
		    },
		    {
		        text: 'QQ空间',
		        icon: 'widget://image/icon_kongjian.png'
		    }
		    ],
		    styles:{
		        bg:'#FFF',
		        column: 4,
		        itemText: {
		            color: '#000',
		            size: 12,
		            marginT:8
		        },
		        itemIcon:{
		            size:60
		        },
		        cancel:{  
//		            bg:'widget://image/icno_share_buttom.png',
		            color:'#000',          
		            h: 40 ,                 
		            size: 14       
		        }
		    }
		  }, function(ret){

			   var eventType= ret.eventType;//判断类型
			   var index=ret.index;
			    if(eventType=='cancel'){//关闭
			      dialogBox.close({ dialogName: 'actionMenu'});
			       return;
			    }
			 if(index==1||index==3){
			
			   var qq = api.require('qq');
			   qq.installed(function(ret, err) {
		
			    if (ret.status) {
			     if(index==1){//qq
			     
				  qq.shareNews({
				    url: url,
				    type:'QFriend',
				    title: '长风实习平台，学生实习数据统计分析',
				    description: '长风实习平台，学生实习数据统计分析',
				    imgUrl: 'http://bos.cfnet.org.cn/img/20160909/1473386274-30412-15841.jpg'
				   },function(ret,err){
				     dialogBox.close({  dialogName: 'actionMenu'});
				                if (ret) {
//				                   api.toast({
//				                      msg:'分享成功'
//			                        });
				                }else {
				                     api.alert({msg:JSON.stringify(err)});
				                }
				            });
			        }else if(index==3) {//qq空间
			         qq.shareNews({
					    url: url,
					    type:'QZone',
					    title: '长风实习平台，学生实习数据统计分析',
					    description: '长风实习平台，学生实习数据统计分析',
					    imgUrl: 'http://bos.cfnet.org.cn/img/20160909/1473386274-30412-15841.jpg'
					   },function(ret,err){
					     dialogBox.close({  dialogName: 'dialogBox'});
					                if (ret) {
					                   
//					                   api.toast({
//				                         msg:'分享成功'
//			                            });
					                }else {
					                     api.alert({msg:JSON.stringify(err)});
					                }
					            });
			         }
			          return;
			    } else {
			    
			       dialogBox.close({  dialogName: 'actionMenu'});
		      	alert("没有安装QQ");
//			     $("#passFailCount").show();
//				     $("#title_text").html('没有安装QQ');
			                        
			    }
			});
			  }
			 if(index==0||index==2){
			   var wx = api.require('wx');
			   wx.isInstalled(function(ret, err) {
			    if (ret.installed) {
			     if(index==0){//微信
			     wx.shareWebpage({
				    apiKey: '',
				    scene: 'session',
				    title: '长风实习平台，学生实习数据统计分析',
				    description: '长风实习平台，学生实习数据统计分析',
				    thumb: 'http://bos.cfnet.org.cn/img/20160909/1473386274-30412-15841.jpg',
				    contentUrl: url
				     }, function(ret, err) {
				        dialogBox.close({  dialogName: 'actionMenu'});
					    if (ret.status) {
					       
//					        api.toast({
//				                msg:'分享成功'
//			                });
					    } else {
					      
					    }
				     });
			      }else if(index==2){//朋友圈
			      wx.shareWebpage({
				    apiKey: '',
				    scene: 'timeline',
				    title: '长风实习平台，学生实习数据统计分析',
				    description: '长风实习平台，学生实习数据统计分析',
				    thumb: 'http://bos.cfnet.org.cn/img/20160909/1473386274-30412-15841.jpg',
				    contentUrl: url
					}, function(ret, err) {
					    dialogBox.close({  dialogName: 'actionMenu'});
					    if (ret.status) {
					   
//					       api.toast({
//				                msg:'分享成功'
//			                });
					    } else {
					      
					    }
					});
			        
			        }
			       
			    } else {
			       dialogBox.close({  dialogName: 'actionMenu'});
			    	alert("没有安装微信");
//			   $("#passFailCount").show();
//				       $("#title_text").html('没有安装微信');
			                     
			       
			    }
			});
			}

});


	}
</script>
</html>